package com.bulls.demo.hrmsdemo.constants;

import javax.persistence.EntityManager;
import javax.persistence.Persistence;

public class EntityManagerFactory {
	
	   private static EntityManager em=null;

	   static javax.persistence.EntityManagerFactory emf;
	    
	    public static EntityManager getEntityManager(){


	        emf = Persistence.createEntityManagerFactory("pu");
	        if(emf == null){
	        	System.out.println("em is null");
	        }else{
	        	System.out.println("em is created");
	        }
	        em = emf.createEntityManager();
	        System.out.println("em is created="+em);
			return em;
	    }


}
